Use gdk_threads_add_idle instead of g_idle_add. Add a temporary check if
authorRichard Hult <richard@imendio.com>
Sat, 17 May 2008 07:26:41 +0000 (07:26 +0000)
committerRichard Hult <rhult@src.gnome.org>
Sat, 17 May 2008 07:26:41 +0000 (07:26 +0000)
2008-05-17  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkwindow-quartz.c:
(gdk_window_impl_quartz_invalidate_maybe_recurse):
(gdk_window_quartz_update_idle): Use gdk_threads_add_idle instead
of g_idle_add. Add a temporary check if the window is already in
the updates list, since update_area currently doesn't always match
the backend's state, see bug #530801.

svn path=/trunk/; revision=20108

ChangeLog
gdk/quartz/gdkwindow-quartz.c

index b60b5daec016c9fc71d9694dc7ae99d39fbc4aab..bee6e75799af11b94605b3aa1ca53ed2ce01b6ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-05-17  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkwindow-quartz.c:
+       (gdk_window_impl_quartz_invalidate_maybe_recurse):
+       (gdk_window_quartz_update_idle): Use gdk_threads_add_idle instead
+       of g_idle_add. Add a temporary check if the window is already in
+       the updates list, since update_area currently doesn't always match
+       the backend's state, see bug #530801.
+
 2008-05-13  Tor Lillqvist  <tml@novell.com>
 
        Bug 496958 - Wacom Bamboo doesn't function with GTK apps in Win32
index 997e90db6cf50d0f19c68c5fadc4f786aa508a99..ae7a191b2d02b3aa0770647af0d3167d14e79fa3 100644 (file)
@@ -393,9 +393,7 @@ gdk_window_quartz_process_all_updates (void)
 static gboolean
 gdk_window_quartz_update_idle (gpointer data)
 {
-  GDK_THREADS_ENTER ();
   gdk_window_quartz_process_all_updates ();
-  GDK_THREADS_LEAVE ();
 
   return FALSE;
 }
@@ -422,12 +420,17 @@ gdk_window_impl_quartz_invalidate_maybe_recurse (GdkPaintable    *paintable,
     }
   else
     {
-      update_windows = g_slist_prepend (update_windows, window);
+      /* FIXME: When the update_window/update_area handling is abstracted in
+       * some way, we can remove this check. Currently it might be cleared
+       * in the generic code without us knowing, see bug #530801.
+       */
+      if (!g_slist_find (update_windows, window))
+        update_windows = g_slist_prepend (update_windows, window);
       private->update_area = visible_region;
 
       if (update_idle == 0)
-       update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
-                                      gdk_window_quartz_update_idle, NULL, NULL);
+        update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
+                                                 gdk_window_quartz_update_idle, NULL, NULL);
     }
 }